Test Series - Data Structure

Test Number 17/115

Q: In linked list implementation of queue, if only front pointer is maintained, which of the following operation take worst case linear time?
A. Insertion
B. Deletion
C. To empty a queue
D. Both Insertion and To empty a queue
Solution: Since front pointer is used for deletion, so worst time for the other two cases.
Q: In linked list implementation of a queue, where does a new element be inserted?
A. At the head of link list
B. At the centre position in the link list
C. At the tail of the link list
D. At any position in the linked list
Solution: Since queue follows FIFO so new element inserted at last.
Q: In linked list implementation of a queue, front and rear pointers are tracked. Which of these pointers will change during an insertion into a NONEMPTY queue?
A. Only front pointer
B. Only rear pointer
C. Both front and rear pointer
D. No pointer will be changed
Solution: Since queue follows FIFO so new element inserted at last.
Q: In linked list implementation of a queue, front and rear pointers are tracked. Which of these pointers will change during an insertion into EMPTY queue?
A. Only front pointer
B. Only rear pointer
C. Both front and rear pointer
D. No pointer will be changed
Solution: Since its the starting of queue, so both values are changed.
Q:  In case of insertion into a linked queue, a node borrowed from the __________ list is inserted in the queue.
A. AVAIL
B. FRONT
C. REAR
D. NULL
Solution: All the nodes are collected in AVAIL list.
Q: In linked list implementation of a queue, from where is the item deleted?
A. At the head of link list
B. At the centre position in the link list
C. At the tail of the link list
D. Node before the tail
Solution: Since queue follows FIFO so new element deleted from first.
Q: In linked list implementation of a queue, the important condition for a queue to be empty is?
A. FRONT is null
B. REAR is null
C. LINK is empty
D. FRONT==REAR-1
Solution: Because front represents the deleted nodes.
Q: The essential condition which is checked before insertion in a linked queue is?
A. Underflow
B. Overflow
C. Front value
D. Rear value
Solution: To check whether there is space in the queue or not.
Q: The essential condition which is checked before deletion in a linked queue is?
A. Underflow
B. Overflow
C. Front value
D. Rear value
Solution: To check whether there is element in the list or not.
Q:  Which of the following is true about linked list implementation of queue?
A. In push operation, if new nodes are inserted at the beginning of linked list, then in pop operation, nodes must be removed from end
B. In push operation, if new nodes are inserted at the beginning, then in pop operation, nodes must be removed from the beginning
C. In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from end
D. In push operation, if new nodes are inserted at the end, then in pop operation, nodes must be removed from beginning
Solution: It can be done by both the methods.

You Have Score    /10